source("global.R")
library(ggrepel)
library(ComplexHeatmap)
lipid <- readRDS("../data/untargeted_singletp_fin4_all(single_istd).rds")HDL lipidome quantification (from untargeted)
Analysis based on the targeted lipidomic results. File: mx 733759_Agus_lipidomics_human plasma lipoproteins_07-2023 submit.xlsx. The peak heights were converted to ng/mL based on the amount and peak height of iSTD.
Data processing
Peak heights across samples were normalized using all iSTDs.
Features has been filtered by WCMC regarding the peak heights in samples and blanks.
Features with InChI Keys that couldn’t be found in the PubChem were excluded.
Compounds with identical InChI Keys were selected by lowest CV in pooled samples.
Assign lipid class from LIPID MAPS and manually curated table.
Concentration were calculated based the istd with most similar unsaturation and then chain length.
Cholesterol istd is missing. Import the value from mx733759_Agus_Lipids_Single-point quant_with cholesterol_Submit_10-17-23.xlsx
Total peak heights consists of major lipid species which can be quantified with iSTDs and minor species which don’t have corresponding iSTDs. The percentage of both types of species are shown below.
peak <- lipid$peak
lipid <- lipid$quant
peak$fdata$major <- ifelse(featureNames(peak) %in% featureNames(lipid), "Major", "Minor")
lipid.major <- summarize_feature(peak, "major")$edata
lipid.major <- apply(lipid.major, 2, function(x)x/sum(x)*100)
df <- as.data.frame(lipid.major) %>%
rownames_to_column("Type") %>%
pivot_longer(cols = contains("_0"), names_to = "fraction", values_to = "Perc") %>%
mutate(fraction = factor(fraction, levels = colnames(lipid.major))) %>%
group_by(fraction) %>%
mutate(ypos = 100 - cumsum(Perc) + 0.5 * Perc)
ggplot(df, aes(x = "", y = Perc, fill = Type)) +
geom_bar(stat = "identity", color = "white") +
geom_label(aes(y = ypos, label = round(Perc, 1)), fill = "white") +
coord_polar("y", start = 0) +
theme_void() +
scale_fill_npg() +
facet_wrap(~fraction, nrow = 3)The quantified data only included major lipid species.
CVs of pooled samples
The CVs of pooled samples for each lipid species were calculated using the following formula:
\[ CV_{lipid\ species} = SD_{lipid\ species}/Mean_{lipid\ species} * 100\% \]
We are less confident with the lipid species with a high CV. These lipid species will be excluded for further analysis.
hist(lipid$fdata$qc_cv, main = "The distribution of CVs")sum(lipid$fdata$qc_cv>30)[1] 11
We excluded lipid species with a CV > 30%. 11 features were excluded.
lipid <- subset_features(lipid, lipid$fdata$qc_cv<30)Following analysis included all quantified lipid species.
Included all quantified lipid species. 456 lipid species for analysis.
Lipid class
Pie chart
lipid.class3 <- subset_features(lipid, !is.na(lipid$fdata$
class))
lipid.class3 <- summarize_feature(lipid.class3, "class")
edata.prop3 <- apply(lipid.class3$edata, 2, function(col){
col/sum(col)*100
})
# pie chart
pies.class3 <- lapply(sampleNames(lipid), plotPie, edata.prop3)
legend.class3 <- get_legend(pies.class3[[1]]+theme(legend.position = "bottom"))
pies.class3 <- lapply(pies.class3, function(x)x+theme(legend.position = "none"))
plot_grid(plotlist = pies.class3, nrow = 3)Bar plot
# bar plot
plotBar(edata.prop3)PCA
edata.scaled3 <- scale(t(edata.prop3), center = T)
res.pca <- PCA(edata.scaled3, scale.unit = T, graph = FALSE)
# fviz_eig(res.pca, addlabels = TRUE)
fviz_pca_ind(res.pca,
axes = c(1,2),
repel = TRUE,
title = NULL
) +
theme_cynthia_bw() +
theme(
legend.position = "none"
) +
labs(title = NULL)Lipid species enriched in fractions
The analysis was based on peak heights. We assumed that the sum of peak heights in each sample represented the total lipid amount. Each lipid species was normalized to the total lipid amount before comparing across samples.
CVs of pooled samples
hist(peak$fdata$qc_cv, main = "The distribution of CVs")sum(peak$fdata$qc_cv>30)[1] 18
We excluded lipid species with a CV > 30%. 18 features were excluded.
For example,
Species level
Class level
peak.class <- summarize_feature(peak, "class")
peak.class.rel <- apply(peak.class$edata, 2, function(x){
x/sum(x)
})
p.class <- enrich_all_fraction(bg.fraction, peak.class.rel, peak.class, TRUE)
# Heatmap of enrich species in each fraction
mat.class <- as.matrix(p.class)
mat.class[mat.class<0.01] <- 0.01
mat.class <- -log(mat.class)
# cols <- RColorBrewer::brewer.pal(name = "Paired", n = 12)
# cols <- colorRampPalette(cols)(13)
# cols <- setNames(cols, rownames(p.class))
Heatmap(mat.class, name = "-log(p)")